﻿/*
Statistic 
Time Limit:1000MS  Memory Limit:32768K


Description:
lily刚学了数理统计，他对频率直方图特感兴趣，所以想对一篇文章的字母进行统计。 
而文章是由四行的大写字母组成的(CAPITAL LETTERS)。
每行不会超过72个字符，请打印一个统计直方图来统计每个字母出现的次数 (不统计空行，数字，标点)。

Input:
1到4行的大写文章，每行不超过72个字符 
Output:
打印统计图，具体如样例（最后不要空行） 
Sample Input:
THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG.
THIS IS AN EXAMPLE TO TEST FOR YOUR
HISTOGRAM PROGRAM.
HELLO!
Sample Output:
							*   				   
							*   				   
		*   				*   				   
		*   				*     *   * 		   
		*   				*     *   * 		   
*   	*     * 			*     *   * 		   
*   	*     * *     * *   *     * * * 		   
*   	*   * * *     * *   * *   * * * *   	  
*     * * * * * *     * * * * *   * * * *     * *  
* * * * * * * * * * * * * * * * * * * * * * * * * *
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
*/
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>

int main(int argc, char* argv[])
{
	const unsigned LINE_SIZE=80U;
	char line[LINE_SIZE+1]={0};
	unsigned heights[26]={0};

	while (gets(line))
	{
		for (char *p=line; *p; ++p)
		{
			++heights[toupper(*p)-'A'];
		}
	}
	unsigned height=*(std::max_element(heights, heights+26));

	while (true)
	{
		for (unsigned i=0; i<25; ++i)
		{
			if(heights[i]<height)
				printf("  ");
			else
				printf("* ");
		}
		if(heights[25]<height)
			putchar(' ');
		else
			putchar('*');
		putchar('\n');

		--height;
		if(!height)
			break;
	}
	for (unsigned i=0; i<25; ++i)
		printf("%c ", 'A'+i);
	putchar('Z');

	return EXIT_SUCCESS;
}
